#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
#include<vector>


//dijkstra
using namespace std;
using PDI = pair<double, int>;

const int N = 2e5 + 10;

int n, m, fo, ed;
int h[N], e[N], ne[N], idx;
double w[N];
double dist[2010];
bool state[2010];

void add(int a, int b, double c){
    e[idx] = b;
    w[idx] = c;
    ne[idx] = h[a];
    h[a] = idx++;
}

double dijkstra(){
    dist[fo] = 1;
    priority_queue<PDI, vector<PDI>, less<PDI>> que;
    que.push({1, fo});

    while(que.size()){
        PDI temp = que.top();
        que.pop();

        int ver = temp.second;
        double cost = temp.first;

        if(state[ver]) continue;

        state[ver] = true;

        for (int u = h[ver]; u != -1; u = ne[u]){
            int j = e[u];
            if(dist[j] < cost * w[u]){
                dist[j] = cost * w[u];
                que.push({dist[j], j});
            }
        }
    }

    return dist[ed];
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    memset(h, -1, sizeof h);
    scanf("%d%d", &n, &m);
    for (int i = 0; i < m; i ++){
        int a, b, c;
        scanf("%d%d%d", &a, &b, &c);
        add(a, b, (double)((100 - c) / 100.0));
        add(b, a, (double)((100 - c) / 100.0));
    }
    scanf("%d%d", &fo, &ed);

    double ans = dijkstra();
    printf("%.8f", 100.0 / ans);


    
    return 0;
}